Thanks for the reply, however that still hasnt solved my problem.
it might make it easier for you to advice if you can see some code;
This is the code from the function that sets up the ui and its elements;
// Setup Pages
mainMenuWidget
= new QWidget(this);
timelineWidget
= new QWidget(this);
directMessagesWidget
= new QWidget(this);
settingsWidget
= new QWidget(this);
// Setup Layouts
// Setup visual widgets
timelineLabel
= new QLabel("Timeline",
this);
directMessagesLabel
= new QLabel("Direct Messages",
this);
searchLabel
= new QLabel("Search",
this);
settingsLabel
= new QLabel("Settings",
this);
// Setup the Mainmenu
//listWidget->setMinimumSize(this->width(), this->height());
std::cout << listWidget->width() << " " << listWidget->height() << std::endl;
std::cout << this->width() << " " << this->height() << std::endl;
listWidget->setAlternatingRowColors(true);
// Setup Pages
mainMenuWidget = new QWidget(this);
timelineWidget = new QWidget(this);
directMessagesWidget = new QWidget(this);
searchWidget = new QWidget(this);
settingsWidget = new QWidget(this);
// Setup Layouts
mainLayout = new QVBoxLayout;
mainMenuLayout = new QVBoxLayout(this);
timelineLayout = new QVBoxLayout(this);
directMessagesLayout = new QVBoxLayout(this);
searchLayout = new QVBoxLayout(this);
settingsLayout = new QVBoxLayout(this);
// Setup visual widgets
timelineLabel = new QLabel("Timeline",this);
directMessagesLabel = new QLabel("Direct Messages",this);
searchLabel = new QLabel("Search", this);
settingsLabel = new QLabel("Settings", this);
backButton = new QPushButton("Back");
// Setup the Mainmenu
QListWidget *listWidget = new QListWidget(this);
//listWidget->setMinimumSize(this->width(), this->height());
std::cout << listWidget->width() << " " << listWidget->height() << std::endl;
std::cout << this->width() << " " << this->height() << std::endl;
listWidget->setAlternatingRowColors(true);
To copy to clipboard, switch view to plain text mode
I then add the listwidgetitems to the list.
The widget is set to showMaximized(); and i want to make the listwidgetitems fit nicely regardsless of the screensize that the app is running on.
timelineButton
->setIcon
(QIcon(":/images/menu/timeline.png"));
timelineButton->setText("Timeline");
//timelineButton->setFont(QFont("Lucida Grande", (listWidget->height()/10), QFont::Bold));
timelineButton->setTextAlignment(Qt::AlignCenter);
//timelineButton->setSizeHint(QSize(0,((listWidget->height())/4)));
listWidget->addItem(timelineButton);
QListWidgetItem *timelineButton = new QListWidgetItem(listWidget, 1000);
timelineButton->setIcon(QIcon(":/images/menu/timeline.png"));
timelineButton->setText("Timeline");
//timelineButton->setFont(QFont("Lucida Grande", (listWidget->height()/10), QFont::Bold));
timelineButton->setTextAlignment(Qt::AlignCenter);
//timelineButton->setSizeHint(QSize(0,((listWidget->height())/4)));
listWidget->addItem(timelineButton);
To copy to clipboard, switch view to plain text mode
the calls to listWidget->height(); and listWidget->viewport->height(); always return the same value regards of what size the widget is set to start at.
for example if i w.resize(400,500); before calling w.show() the size return is the same as when the window is started with w.showMaximized();
Does this shed anymore light on the problem?
Thanks,
Dubstar_04
Bookmarks