Click here to Skip to main content
15,885,754 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi.i have program it has some classes.one of these classes inherites from QMainwindow.i write blew code to put QScrollArea in this code.i have two problem.1_ two windows open(main window of program with a empty window).2_ when main window is in minimum state,it shows horizontal and vertical Scroll but when is in maximum state,it shows only vertical Scroll.i put two QLabel in main window that is shown Incompletely.
(sorry for english )
C++
#include <QScrollArea>
private:
     QWidget* wi;
     QPushButton* La_yellow;
     QPushButton* La_green;
     QScrollArea* H;
//////////////////////
 wi=new QWidget;
    wi->resize((row-1)*60+400,(co-1)*60+400);
    wi->setFixedSize((row-1)*60+400,(co-1)*60+400);
setCentralWidget(wi);
La_yellow->move((row-1)*60+400-220,(co-1)*60+400-80);
     La_green->move((row-1)*60+400-220,(co-1)*60+400-10);
La_yellow->setParent(wi);
     La_green->setParent(wi);
H=new QScrollArea();
     H->setWidget(wi);
     H->raise();
      H->show();

http://s18.postimg.org/lilzmxi3p/New_Bitmap_Image.png[^]
Posted
Updated 10-May-14 7:49am
v2
Comments
Sayan Bera 10-May-14 13:04pm    
Can you take some screenshots of the windows and post the links. because its really hard to understand the problem. Are you adding the controls by QDesigner? What IDE are you using?
mary99 10-May-14 13:07pm    
no.i using Qtcreator.
Sayan Bera 10-May-14 13:18pm    
Sorry, I can't really make-out the problem mentioned. Post some image(PrintScreen). I can suggest you to add all controls QPushButton, QScrollArea, QLabel by opening the .ui file from QDesginer and apply a Grid Layout to the CentralWidget.
mary99 10-May-14 13:33pm    
how to send my image?
Sayan Bera 10-May-14 13:39pm    
Upload image in some sites like postImage.org and post the link here. Like -> http://s28.postimg.org/pf9f1ap5p/Desert.jpg

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900